
import Router from 'vue-router'
import Tab from '@/components/tabbar'
import Vue from 'vue'
import Home from '@/views/home'

Vue.use(Router)

export default new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      name: 'home',
      path: '/',
      components: {
        default: Home,
        tabBar: Tab,
      }
    },
    {
      path: '/items/search',
      //请求路径
      name: 'search',
      meta: {
        keepAlive: true
      },
      component: () => import('@/views/items/search')
      // 导入组件
    },
    {
      path:'/detail/:pid',
      name:'detail',
      props:true,
      component:()=>import('@/views/detail')
    }
  ]
})
